home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / os2 / nortutil.zip / src / WareZ / orig / mcelwain.c
C/C++ Source or Header  |  1994-02-22  |  616b  |  26 lines

  1. /*    McElwainising filter.    version 1.02
  2.  *    Part of the Emperor Norton Utilities. All rites reversed.
  3.  *    UN-altered REPRODUCTION and COMPLIATION of this
  4.  *    IMPORTANT SOURCE CODE is ENCOURAGED (as is alteration)
  5.  *
  6.  *    Author:        acb
  7.  *    Commenced:    27-5-1993
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <ctype.h>
  12.  
  13. main() {
  14.     char c;
  15.     char p='\0';
  16.     int f = 0;
  17.     while((c=getchar())!=EOF) {
  18.         char o;
  19.         f = (c==' '||c=='\n')?!f:f;
  20.         o = f?toupper(c):c;
  21.         putchar(((o=='S')&&(isalpha(p))&&(rand(10)>5))?'$':o);
  22.         p=c;
  23.     };
  24.     printf("\n\t\tUN-altered REPRODUCTION and DISSEMINATION of this\n\t\t   IMPORTANT INFORMATION is ENCOURAGED.\n");
  25. };
  26.